package io.xccit.order.controller;

import io.xccit.order.feign.HkFinanceFeignClient;
import io.xccit.order.params.HkStocksKline;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author CH_ywx
 * @version 1.0
 * @create 2025/5/24
 * <p>第三方接口Controller</p>
 */
@RestController
@RequestMapping("/hk-finance")
public class HkFinanceController {

    @Autowired
    private HkFinanceFeignClient hkFinanceFeignClient;

    @PostMapping("/get-finance-data")
    public String getFinanceData(@RequestParam("appcode") String appcode, @RequestBody HkStocksKline hkStocksKline) {
        System.out.println(appcode);
        String auth = "APPCODE " + appcode;
        System.out.println(auth);
        return hkFinanceFeignClient.getHkFinanceData(auth, hkStocksKline);
    }
}
